<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.*, com.zjr.domain.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="<%=path %>/skin/css/base_style.css" />
<link type="text/css" rel="stylesheet" href="<%=path %>/skin/css/table.css" />
<script type="text/javascript" src="<%=path %>/skin/js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="<%=path %>/skin/js/table.js"></script>
<title>用户列表</title>
<%
	ArrayList<Log> logs = null;
	if(request.getAttribute("logs") != null){
		logs = (ArrayList<Log>)request.getAttribute("logs");
	}else{
		response.sendRedirect(path+"/log/error.jsp");
	}
%>
</head>
<body>
	<table class="tab">
		<tr>
	        <th width="5%" class="tab_th fyh"><img src="<%=path %>/skin/images/lcp_checkbox5.png" /></th>
	        <th width="10%" class="tab_th fyh">ID</th>
	        <th width="10%" class="tab_th fyh">提交者</th>
	        <th width="10%" class="tab_th fyh">提交地点</th>
	        <th width="10%" class="tab_th fyh">工作时长</th>
	        <th width="10%" class="tab_th fyh">提交日期</th>
	        <th width="10%" class="tab_th fyh">日志状态</th>
	        <th width="35%" class="tab_th fyh">操作</th>
    	</tr>
    	<%
    		for(int i = 0; i < logs.size(); i++){
    			Log log = logs.get(i);
    			String state = "";
    			switch(log.getState()){
	    			case 0: state = "未审核";break;
	    			case 1: state = "审核中";break;
	    			case 2: state = "通过审核";break;
    			}
    			%>
    			<tr>
    				<td class="tab_td1 fyh"><img src="<%=path %>/skin/images/lcp_checkbox5.png" /></td>
    				<td class="tab_td1 fyh"><%=log.getLid() %></td>
    				<td class="tab_td1 fyh"><%=log.getUsername() %></td>
    				<td class="tab_td1 fyh"><%=log.getPlace() %></td>
    				<td class="tab_td1 fyh"><%=log.getDuration() %></td>
    				<td class="tab_td1 fyh"><%=log.getSubmittime() %></td>
    				<td class="tab_td1 fyh"><%=state %></td>
    				<td class="tab_td1 fyh">
        				<input type="button" onclick="window.location.href='LogServlet?flag=delete&lid=<%=log.getLid() %>'" value="" class="tab_button1"/>
        				<input type="button" onclick="window.location.href='LogServlet?flag=find&lid=<%=log.getLid() %>'" value="" class="tab_button2" />
       				</td>
    			</tr>
    			<%
    		}
    	%>
	</table>
	<div class="table_page">
	    <input type="button" class="page_button1"/>
	    <input type="button" class="page_button2"/>
	    <label class="page_number">1</label>
	    <label class="page_number">2</label>
	    <input type="button" class="page_button3"/>
	    <input type="button" class="page_button4"/>
	</div>
</body>
</html>